// Raf Lempens & Bjorn Schobben
#include "Wall.h"


Wall::Wall(unsigned int initialCellX, unsigned int initialCellY): GameObject(initialCellX, initialCellY), blockMoveAbility(0), blockHitAbility(0)
{
	blockMoveAbility = new BlockMoveAbility();
	blockHitAbility = new BlockHitAbility();


	AddAbility(blockMoveAbility);
	AddAbility(blockHitAbility);
}

Wall::~Wall()
{
	if (blockMoveAbility)
	{
		delete blockMoveAbility;
		blockMoveAbility = 0;
	}

	if (blockHitAbility)
	{
		delete blockHitAbility;
		blockHitAbility = 0;
	}
}

void Wall::SetDirection(const Direction& direction)
{
	wallDirection = direction;
	blockMoveAbility->SetBlockDirection(direction);
	blockHitAbility->SetBlockDirection(direction);
}
